/* eslint-disable react/no-array-index-key */
import React from 'react';
import styles from './index.less';

export default function Newline({ text }) {
    const next = text?.split('\n');
    return (
        <div className={styles.root}>
            {next.map((item, index) => (
                <span className={styles.item} key={index}>
                    {item}
                </span>
            ))}
        </div>
    );
}
